/**
 * 
 */
package tsli.acm.ctrl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import tsli.acm.dao.SFCCommissionPositiveDAO;
import tsli.acm.database.Database;
import tsli.acm.model.SFCCommissionPositive;

/**
 * @author PabSriwichai
 * 
 */
public class FAComponentAPIMethod {

//	public List<SFCCommissionPositive> calculateFAInMonth(String paClosYm) {
//		String peNo = "221400935";
//		List<SFCCommissionPositive> voSFCCommissionPositive = new ArrayList<SFCCommissionPositive>();
//		Database db = new Database();
//		SFCCommissionPositiveDAO voSFCCommissionPositiveDAO = new SFCCommissionPositiveDAO(db);
//		List<Map<String, Object>> voSFCComPoResult = null;
//		if ((paClosYm.charAt(4) + "" + paClosYm.charAt(5)).equals("03")
//				|| (paClosYm.charAt(4) + "" + paClosYm.charAt(5)).equals("06")
//				|| (paClosYm.charAt(4) + "" + paClosYm.charAt(5)).equals("09")
//				|| (paClosYm.charAt(4) + "" + paClosYm.charAt(5)).equals("12")) {
//			voSFCComPoResult = voSFCCommissionPositiveDAO.findcalculateFAReCAl(paClosYm,peNo);
//		}else{
//			voSFCComPoResult  = voSFCCommissionPositiveDAO.findcalculateFA(paClosYm,peNo);
//		}
//		
//System.out.println("CLOS_YM--PE_NO--PC--FA--PERSISTENCY_RATE--FA_TOTAL");
//		for (int i = 0; i < voSFCComPoResult.size(); i++) {
//			Map<String, Object> voObject = voSFCComPoResult.get(i);
//			SFCCommissionPositive voSFCommissionPositiveObject = new SFCCommissionPositive();
//			// set Clos_YM value
//			voSFCommissionPositiveObject.setVaClosYm(voObject.get("CLOS_YM")
//					.toString());
//			// set PE_NO value
//			voSFCommissionPositiveObject.setVaPeNoBm(voObject.get("PE_NO")
//					.toString());
//			// set PC value
//			voSFCommissionPositiveObject.setVaPeNoChg(voObject.get("PC")
//					.toString());
//			// add Object to List
//			voSFCCommissionPositive.add(voSFCommissionPositiveObject);
//			
///////////////////////			
//if ((paClosYm.charAt(4) + "" + paClosYm.charAt(5)).equals("03")){
//	System.out.println(voObject.get("CLOS_YM").toString() + "--"
//				+ voObject.get("PE_NO").toString() + "--"
//				+ voObject.get("PC").toString() + "--"
//				+ voObject.get("FA").toString() + "--"
//				+ voObject.get("PERSISTENCY_RATE").toString() + "--"
//				+ voObject.get("FA_TOTAL").toString() + "--"
//				+ voObject.get("FA_RECAL").toString());
//}else{
//	System.out.println(voObject.get("CLOS_YM").toString() + "--"
//			+ voObject.get("PE_NO").toString() + "--"
//			+ voObject.get("PC").toString() + "--"
//			+ voObject.get("FA").toString() + "--"
//			+ voObject.get("PERSISTENCY_RATE").toString() + "--"
//			+ voObject.get("FA_TOTAL").toString());
//}
/////////////////////
//
//		}
//		System.out.println("process complete... Total Size = "
//				+ voSFCCommissionPositive.size() + " Object");
//		db.close();
//		return voSFCCommissionPositive;
//	}

}
